# from torch.nn import Module
#
#
# class HG(Module):
#     def __init__(self, name, age):
#         super(HG, self).__init__()
#         self.name = name
#         print("HG init start...")
#         self.age = age
#
#     def forward(self, x):
#         print("HG_x:", x)
#         return x * self.age
#
#
# class DHCN(Module):
#     def _forward(self):
#         pass
#
#     def __init__(self, name, age=1):
#         super(DHCN, self).__init__()
#         self.name = name
#         self.age = age
#         print("DHCN init start....")
#         self.hg = HG(self.name, self.age)
#
#     # forward: Callable[..., any] = _forward
#
#     def forward(self, x):
#         ed = self.hg(x)
#         print("DHCN", x)
#         return str(ed) + self.name
#
#
# model = DHCN("ha")
# ss = model(2)


import time
import datetime


def decorator(func):
    def wrapper(me_instance):
        start_time = time.time()
        func(me_instance)
        end_time = time.time()
        print(end_time - start_time)
    
    return wrapper


class Method(object):
    
    @decorator  # func = decorator(func)
    def func(self):
        time.sleep(0.8)


p1 = Method()
p1.func()  # 函数调用

weekends = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
today = datetime.date.today().weekday()
print(datetime.datetime.today().strftime("%Y-%m-%d %H:%M:%S"))
while today <= 7:
    print("Today is ", weekends[today])
    break
print("hello world")
